/**
 * Created by winter on 2017-04-01.
 */

module.exports = function ($http, httpservice) {

  var service = {
    getLawfirm : getLawfirm,
    sendCode : sendCode,
    updateUserInfo : updateUserInfo
  };
  return service;

  //获取律所列表
  function getLawfirm(name) {
    return $http({
      url: httpservice.lawfirmsUrl,
      method: "GET",
      params: {name: name}
    });
  }

  //更新用户信息
  function updateUserInfo(userInfo) {
    return $http({
      url: httpservice.updateUserInfoUrl,
      method:"PUT",
      headers : {'Content-Type':'application/json'},
      data: userInfo
    })
  }

  function sendCode(phone) {
    return $http({
      url: httpservice.getVerifyCodeInfoPlusUrl,
      method:"POST",
      headers : {'Content-Type':'application/json'},
      data: {cellphone: phone, mode:6}
    })
  }

};
